package com.xiyuan.smartutils.logging;

import java.util.Date;
import java.util.List;

/**
 * the description for class Record
 *
 * @author xiyuan-lgz 2022-10-19 @version v1.0.0 新建与整理
 */
public class LogRecord {
    private String name;
    private Date time = new Date();
    private Level level;
    private String clazz;
    private String method;
    private String message;
    private Throwable thrown;
    
    private String fileName;
    private int lineNumber;
    
    private List<Object> params;
    
    public List<Object> getParams() {
        return params;
    }
    
    public void setParams(List<Object> params) {
        this.params = params;
    }
    
    public String getFileName() {
        return fileName;
    }
    
    public void setFileName(String fileName) {
        this.fileName = fileName;
    }
    
    public int getLineNumber() {
        return lineNumber;
    }
    
    public void setLineNumber(int lineNumber) {
        this.lineNumber = lineNumber;
    }
    
    public String getSourceLineNumber() {
        return fileName == null ? "unkown" : fileName + (lineNumber <= 0 ? "" : ":" + lineNumber);
    }
    
    public String getName() {
        return name;
    }
    
    public void setName(String name) {
        this.name = name;
    }
    
    public Level getLevel() {
        return level;
    }
    
    public void setLevel(Level level) {
        this.level = level;
    }
    
    public Date getTime() {
        return time;
    }
    
    public void setTime(Date time) {
        this.time = time;
    }
    
    public String getClazz() {
        return clazz;
    }
    
    public void setClazz(String clazz) {
        this.clazz = clazz;
    }
    
    public String getMethod() {
        return method;
    }
    
    public void setMethod(String method) {
        this.method = method;
    }
    
    public String getMessage() {
        return message;
    }
    
    public void setMessage(String message) {
        this.message = message;
    }
    
    public Throwable getThrown() {
        return thrown;
    }
    
    public void setThrown(Throwable thrown) {
        this.thrown = thrown;
    }
}
